Package-level declarations

Functions

Link copied to clipboard
fun clamp(value: Double, min: Double, max: Double): Double

Restricts a value to the range min, max degrees, clamping values outside the range. Values less than min are returned as min, and values greater than max are returned as max. Values within the range are returned unmodified.
The result of this method is undefined if min is greater than max.

Link copied to clipboard

Packs vec2 into one float value.

Link copied to clipboard
fun fract(value: Double): Double

Returns the fractional part of a specified positive number

Link copied to clipboard
fun interpolate(amount: Double, value1: Double, value2: Double): Double

Computes the linear interpolation of two values according to a specified fractional amount. The fractional amount is interpreted as a relative proportion of the two values, where 0.0 indicates the first value, 0.5 indicates a 50/50 mix of the two values, and 1.0 indicates the second value.
The result of this method is undefined if the amount is outside the range 0, 1.

Link copied to clipboard
fun isPowerOfTwo(value: Int): Boolean

Indicates whether a specified value is a power of two.

Link copied to clipboard
fun mod(value: Int, modulus: Int): Int

Returns the integer modulus of a specified number. This differs from the % operator in that the result is always positive when the modulus is positive. For example -1 % 10 = -1, whereas mod(-1, 10) = 1.

Link copied to clipboard

Returns the value that is the nearest power of 2 greater than or equal to the given value.

Link copied to clipboard

Returns the value that is the nearest power of 2 less than or equal to the given value.